package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.Dao.Impl.BannerDaoImpl;
import com.ysd.Dao.Impl.CompanyDaoImpl;
import com.ysd.entity.Banner;
import com.ysd.entity.Company;
public class HeadServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		//调用实现类的方法
				CompanyDaoImpl cDao = new CompanyDaoImpl();
				Company  c = cDao.getCompany();
				request.setAttribute("c", c);
				//调用轮播图实现类的方法
				BannerDaoImpl bDao=new BannerDaoImpl();
				List<Banner> b = bDao.getBanner();
				request.setAttribute("b", b);
				request.getRequestDispatcher("head.jsp").include(request, response);
	
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
